<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="日期" prop="cDate">
        <el-date-picker
          v-model="queryParams.cDate"
          type="date"
          size="small"
          value-format="yyyy-MM-dd"
          @keyup.enter.native="handleQuery"
          placeholder="请输入查询日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['scrb:hbzx:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['scrb:hbzx:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['scrb:hbzx:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['scrb:hbzx:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="hbzxList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="日期" align="center" prop="cDate" />
      <el-table-column label="一焦炉颗粒物排放量" align="center" prop="cHbzxl1jlKlw" />
      <el-table-column label="一焦炉二氧化硫排放量" align="center" prop="cHbzx1jl2yhl" />
      <el-table-column label="一焦炉氮氧化物排放量" align="center" prop="cHbzx1jlDyhw" />
      <el-table-column label="二焦炉颗粒物排放量" align="center" prop="cHbzx2jlKlw" />
      <el-table-column label="二焦炉二氧化硫排放量" align="center" prop="cHbzx2jl2yhl" />
      <el-table-column label="二焦炉氮氧化物排放量" align="center" prop="cHbzx2jlDyhw" />
      <el-table-column label="五焦炉颗粒物排放量" align="center" prop="cHbzx5jlKlw" />
      <el-table-column label="五焦炉二氧化硫排放量" align="center" prop="cHbzx5jl2yhl" />
      <el-table-column label="五焦炉氮氧化物排放量" align="center" prop="cHbzx5jlDyhw" />
      <el-table-column label="六焦炉颗粒物排放量" align="center" prop="cHbzx6jlKlw" />
      <el-table-column label="六焦炉二氧化硫排放量" align="center" prop="cHbzx6jl2yhl" />
      <el-table-column label="六焦炉氮氧化物排放量" align="center" prop="cHbzx6jlDyhw" />
      <el-table-column label="焦化锅炉颗粒物排放量" align="center" prop="cHbzxJhglKlw" />
      <el-table-column label="焦化锅炉二氧化硫排放量" align="center" prop="cHbzxJhgl2yhl" />
      <el-table-column label="焦化锅炉氮氧化物排放量" align="center" prop="cHbzxJhglDyhw" />
      <el-table-column label="6号锅炉颗粒物排放量" align="center" prop="cHbzx6glKlw" />
      <el-table-column label="6号锅炉二氧化硫排放量" align="center" prop="cHbzx6hgl2yhl" />
      <el-table-column label="6号锅炉氮氧化物排放量" align="center" prop="cHbzx6hglDyhw" />
      <el-table-column label="1号回转窑颗粒物排放量" align="center" prop="cHbzx1hzyKlw" />
      <el-table-column label="1号回转窑二氧化硫排放量" align="center" prop="cHbzx1hzy2yhl" />
      <el-table-column label="1号回转窑氮氧化物排放量" align="center" prop="cHbzx1hzyDyhw" />
      <el-table-column label="2号回转窑颗粒物排放量" align="center" prop="cHbzx2hzyKlw" />
      <el-table-column label="2号回转窑二氧化硫排放量" align="center" prop="cHbzx2hzy2yhl" />
      <el-table-column label="2号回转窑氮氧化物排放量" align="center" prop="cHbzx2hzyDyhw" />
      <el-table-column label="氢冶金颗粒物排放量" align="center" prop="cHbzxQyjKlw" />
      <el-table-column label="氢冶金二氧化硫排放量" align="center" prop="cHbzxQyj2yhl" />
      <el-table-column label="氢冶金氮氧化物排放量" align="center" prop="cHbzxQyjDyhw" />
      <el-table-column label="1号电炉颗粒物排放量" align="center" prop="cHbzx1dlKlw" />
      <el-table-column label="1号电炉二氧化硫排放量" align="center" prop="cHbzx1dl2yhl" />
      <el-table-column label="1号电炉氮氧化物排放量" align="center" prop="cHbzx1dlDyhw" />
      <el-table-column label="2号电炉颗粒物排放量" align="center" prop="cHbzx2dlKlw" />
      <el-table-column label="2号电炉二氧化硫排放量" align="center" prop="cHbzx2dl2yhl" />
      <el-table-column label="2号电炉氮氧化物排放量" align="center" prop="cHbzx2dlDyhw" />

      <el-table-column label="二线颗粒物排放量" align="center" prop="zfree1" />
      <el-table-column label="二线二氧化硫排放量" align="center" prop="zfree2" />
      <el-table-column label="二线氮氧化物排放量" align="center" prop="zfree3" />
      <el-table-column label="二棒颗粒物排放量" align="center" prop="zfree4" />
      <el-table-column label="二棒二氧化硫排放量" align="center" prop="zfree5" />
      <el-table-column label="二棒氮氧化物排放量" align="center" prop="zfree6" />
      <el-table-column label="三棒颗粒物排放量" align="center" prop="zfree7" />
      <el-table-column label="三棒二氧化硫排放量" align="center" prop="zfree8" />
      <el-table-column label="三棒氮氧化物排放量" align="center" prop="zfree9" />
      <el-table-column label="型材颗粒物排放量" align="center" prop="zfree10" />
      <el-table-column label="型材二氧化硫排放量" align="center" prop="zfree11" />
      <el-table-column label="型材氮氧化物排放量" align="center" prop="zfree12" />

      <el-table-column label="备注" align="center" prop="remake" />
      <el-table-column label="删除标志" align="center" prop="cState" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['scrb:hbzx:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['scrb:hbzx:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改环保中心生产日报录入对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="日期" prop="cDate" >
          <el-date-picker
            v-model="form.cDate"
            :disabled=!isInsert
            type="date"
            size="small"
            value-format="yyyy-MM-dd"
            placeholder="请输入日期">
          </el-date-picker>
        </el-form-item>

       <table>
         <caption>污染物排放</caption>
         <tr>
           <td width="80px"></td>
           <td>1#焦炉</td>
           <td>2#焦炉</td>
           <td>5#焦炉</td>
           <td>6#焦炉</td>
           <td>焦化锅炉</td>
           <td>6#锅炉</td>
         </tr>
         <tr>
           <td>颗粒物</td>
           <td><el-input v-model="form.cHbzxl1jlKlw" placeholder="请输入1#焦炉颗粒物" /></td>
           <td><el-input v-model="form.cHbzx2jlKlw" placeholder="请输入2#焦炉颗粒物" /></td>
           <td><el-input v-model="form.cHbzx5jlKlw" placeholder="请输入5#焦炉颗粒物" /></td>
           <td><el-input v-model="form.cHbzx6jlKlw" placeholder="请输入6#焦炉颗粒物" /></td>
           <td><el-input v-model="form.cHbzxJhglKlw" placeholder="请输入焦化锅炉颗粒物" /></td>
           <td><el-input v-model="form.cHbzx6glKlw" placeholder="请输入6#锅炉颗粒物" /></td>
         </tr>
         <tr>
           <td>二氧化硫</td>
           <td><el-input v-model="form.cHbzx1jl2yhl" placeholder="请输入1#焦炉二氧化硫" /></td>
           <td><el-input v-model="form.cHbzx2jl2yhl" placeholder="请输入2#焦炉二氧化硫" /></td>
           <td><el-input v-model="form.cHbzx5jl2yhl" placeholder="请输入5#焦炉二氧化硫" /></td>
           <td><el-input v-model="form.cHbzx6jl2yhl" placeholder="请输入6#焦炉二氧化硫" /></td>
           <td><el-input v-model="form.cHbzxJhgl2yhl" placeholder="请输入焦化锅炉二氧化硫" /></td>
           <td><el-input v-model="form.cHbzx6hgl2yhl" placeholder="请输入6#锅炉二氧化硫" /></td>
         </tr>
         <tr>
           <td>氮氧化物</td>
           <td><el-input v-model="form.cHbzx1jlDyhw" placeholder="请输入1#焦炉氮氧化物" /></td>
           <td><el-input v-model="form.cHbzx2jlDyhw" placeholder="请输入2#焦炉氮氧化物" /></td>
           <td><el-input v-model="form.cHbzx5jlDyhw" placeholder="请输入5#焦炉氮氧化物" /></td>
           <td><el-input v-model="form.cHbzx6jlDyhw" placeholder="请输入6#焦炉氮氧化物" /></td>
           <td><el-input v-model="form.cHbzxJhglDyhw" placeholder="请输入焦化锅炉氮氧化物" /></td>
           <td><el-input v-model="form.cHbzx6hglDyhw" placeholder="请输入6#锅炉氮氧化物" /></td>
         </tr>
       </table>
        <table>
          <caption></caption>
          <tr>
            <td width="80px"></td>
            <td>1#回转窑</td>
            <td>2#回转窑</td>
            <td>氢冶金</td>
            <td>1#电炉</td>
            <td>2#电炉</td>
            <!--<td></td>-->
          </tr>
          <tr>
            <td>颗粒物</td>
            <td><el-input v-model="form.cHbzx1hzyKlw" placeholder="请输入1#回转窑颗粒物" /></td>
            <td><el-input v-model="form.cHbzx2hzyKlw" placeholder="请输入2#回转窑颗粒物" /></td>
            <td><el-input v-model="form.cHbzxQyjKlw" placeholder="请输入氢冶金颗粒物" /></td>
            <td><el-input v-model="form.cHbzx1dlKlw" placeholder="请输入1#电炉颗粒物" /></td>
            <td><el-input v-model="form.cHbzx2dlKlw" placeholder="请输入2#电炉颗粒物" /></td>
            <!--<td></td>-->
          </tr>
          <tr>
            <td>二氧化硫</td>
            <td><el-input v-model="form.cHbzx1hzy2yhl" placeholder="请输入1#回转窑二氧化硫" /></td>
            <td><el-input v-model="form.cHbzx2hzy2yhl" placeholder="请输入2#回转窑二氧化硫" /></td>
            <td><el-input v-model="form.cHbzxQyj2yhl" placeholder="请输入氢冶金二氧化硫" /></td>
            <td><el-input v-model="form.cHbzx1dl2yhl" placeholder="请输入1#电炉二氧化硫" /></td>
            <td><el-input v-model="form.cHbzx2dl2yhl" placeholder="请输入2#电炉二氧化硫" /></td>
            <!--<td></td>-->
          </tr>
          <tr>
            <td>氮氧化物</td>
            <td><el-input v-model="form.cHbzx1hzyDyhw" placeholder="请输入1#回转窑氮氧化物" /></td>
            <td><el-input v-model="form.cHbzx2hzyDyhw" placeholder="请输入2#回转窑氮氧化物" /></td>
            <td><el-input v-model="form.cHbzxQyjDyhw" placeholder="请输入氢冶金氮氧化物" /></td>
            <td><el-input v-model="form.cHbzx1dlDyhw" placeholder="请输入1#电炉氮氧化物" /></td>
            <td><el-input v-model="form.cHbzx2dlDyhw" placeholder="请输入2#电炉氮氧化物" /></td>
            <!--<td></td>-->
          </tr>
        </table>

        <table>
          <caption></caption>
          <tr>
            <td width="80px"></td>
            <td>二线</td>
            <td>二棒</td>
            <td>三棒</td>
            <td>型材</td>
          </tr>
          <tr>
            <td>颗粒物</td>
            <td><el-input v-model="form.zfree1" placeholder="请输入二线颗粒物" /></td>
            <td><el-input v-model="form.zfree4" placeholder="请输入二棒颗粒物" /></td>
            <td><el-input v-model="form.zfree7" placeholder="请输入三棒颗粒物" /></td>
            <td><el-input v-model="form.zfree10" placeholder="请输入型材颗粒物" /></td>
          </tr>
          <tr>
            <td>二氧化硫</td>
            <td><el-input v-model="form.zfree2" placeholder="请输入二线二氧化硫" /></td>
            <td><el-input v-model="form.zfree5" placeholder="请输入二棒二氧化硫" /></td>
            <td><el-input v-model="form.zfree8" placeholder="请输入三棒二氧化硫" /></td>
            <td><el-input v-model="form.zfree11" placeholder="请输入型材二氧化硫" /></td>
          </tr>
          <tr>
            <td>氮氧化物</td>
            <td><el-input v-model="form.zfree3" placeholder="请输入二线氮氧化物" /></td>
            <td><el-input v-model="form.zfree6" placeholder="请输入二棒氮氧化物" /></td>
            <td><el-input v-model="form.zfree9" placeholder="请输入三棒氮氧化物" /></td>
            <td><el-input v-model="form.zfree12" placeholder="请输入型材氮氧化物" /></td>
          </tr>
        </table>


        <!--<el-form-item label="一焦炉颗粒物排放量" prop="cHbzxl1jlKlw">-->
          <!--<el-input v-model="form.cHbzxl1jlKlw" placeholder="请输入一焦炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="一焦炉二氧化硫排放量" prop="cHbzx1jl2yhl">-->
          <!--<el-input v-model="form.cHbzx1jl2yhl" placeholder="请输入一焦炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="一焦炉氮氧化物排放量" prop="cHbzx1jlDyhw">-->
          <!--<el-input v-model="form.cHbzx1jlDyhw" placeholder="请输入一焦炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="二焦炉颗粒物排放量" prop="cHbzx2jlKlw">-->
          <!--<el-input v-model="form.cHbzx2jlKlw" placeholder="请输入二焦炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="二焦炉二氧化硫排放量" prop="cHbzx2jl2yhl">-->
          <!--<el-input v-model="form.cHbzx2jl2yhl" placeholder="请输入二焦炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="二焦炉氮氧化物排放量" prop="cHbzx2jlDyhw">-->
          <!--<el-input v-model="form.cHbzx2jlDyhw" placeholder="请输入二焦炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="五焦炉颗粒物排放量" prop="cHbzx5jlKlw">-->
          <!--<el-input v-model="form.cHbzx5jlKlw" placeholder="请输入五焦炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="五焦炉二氧化硫排放量" prop="cHbzx5jl2yhl">-->
          <!--<el-input v-model="form.cHbzx5jl2yhl" placeholder="请输入五焦炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="五焦炉氮氧化物排放量" prop="cHbzx5jlDyhw">-->
          <!--<el-input v-model="form.cHbzx5jlDyhw" placeholder="请输入五焦炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="六焦炉颗粒物排放量" prop="cHbzx6jlKlw">-->
          <!--<el-input v-model="form.cHbzx6jlKlw" placeholder="请输入六焦炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="六焦炉二氧化硫排放量" prop="cHbzx6jl2yhl">-->
          <!--<el-input v-model="form.cHbzx6jl2yhl" placeholder="请输入六焦炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="六焦炉氮氧化物排放量" prop="cHbzx6jlDyhw">-->
          <!--<el-input v-model="form.cHbzx6jlDyhw" placeholder="请输入六焦炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="焦化锅炉颗粒物排放量" prop="cHbzxJhglKlw">-->
          <!--<el-input v-model="form.cHbzxJhglKlw" placeholder="请输入焦化锅炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="焦化锅炉二氧化硫排放量" prop="cHbzxJhgl2yhl">-->
          <!--<el-input v-model="form.cHbzxJhgl2yhl" placeholder="请输入焦化锅炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="焦化锅炉氮氧化物排放量" prop="cHbzxJhglDyhw">-->
          <!--<el-input v-model="form.cHbzxJhglDyhw" placeholder="请输入焦化锅炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="6号锅炉颗粒物排放量" prop="cHbzx6glKlw">-->
          <!--<el-input v-model="form.cHbzx6glKlw" placeholder="请输入6号锅炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="6号锅炉二氧化硫排放量" prop="cHbzx6hgl2yhl">-->
          <!--<el-input v-model="form.cHbzx6hgl2yhl" placeholder="请输入6号锅炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="6号锅炉氮氧化物排放量" prop="cHbzx6hglDyhw">-->
          <!--<el-input v-model="form.cHbzx6hglDyhw" placeholder="请输入6号锅炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号回转窑颗粒物排放量" prop="cHbzx1hzyKlw">-->
          <!--<el-input v-model="form.cHbzx1hzyKlw" placeholder="请输入1号回转窑颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号回转窑二氧化硫排放量" prop="cHbzx1hzy2yhl">-->
          <!--<el-input v-model="form.cHbzx1hzy2yhl" placeholder="请输入1号回转窑二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号回转窑氮氧化物排放量" prop="cHbzx1hzyDyhw">-->
          <!--<el-input v-model="form.cHbzx1hzyDyhw" placeholder="请输入1号回转窑氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号回转窑颗粒物排放量" prop="cHbzx2hzyKlw">-->
          <!--<el-input v-model="form.cHbzx2hzyKlw" placeholder="请输入2号回转窑颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号回转窑二氧化硫排放量" prop="cHbzx2hzy2yhl">-->
          <!--<el-input v-model="form.cHbzx2hzy2yhl" placeholder="请输入2号回转窑二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号回转窑氮氧化物排放量" prop="cHbzx2hzyDyhw">-->
          <!--<el-input v-model="form.cHbzx2hzyDyhw" placeholder="请输入2号回转窑氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="氢冶金颗粒物排放量" prop="cHbzxQyjKlw">-->
          <!--<el-input v-model="form.cHbzxQyjKlw" placeholder="请输入氢冶金颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="氢冶金二氧化硫排放量" prop="cHbzxQyj2yhl">-->
          <!--<el-input v-model="form.cHbzxQyj2yhl" placeholder="请输入氢冶金二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="氢冶金氮氧化物排放量" prop="cHbzxQyjDyhw">-->
          <!--<el-input v-model="form.cHbzxQyjDyhw" placeholder="请输入氢冶金氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号电炉颗粒物排放量" prop="cHbzx1dlKlw">-->
          <!--<el-input v-model="form.cHbzx1dlKlw" placeholder="请输入1号电炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号电炉二氧化硫排放量" prop="cHbzx1dl2yhl">-->
          <!--<el-input v-model="form.cHbzx1dl2yhl" placeholder="请输入1号电炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="1号电炉氮氧化物排放量" prop="cHbzx1dlDyhw">-->
          <!--<el-input v-model="form.cHbzx1dlDyhw" placeholder="请输入1号电炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号电炉颗粒物排放量" prop="cHbzx2dlKlw">-->
          <!--<el-input v-model="form.cHbzx2dlKlw" placeholder="请输入2号电炉颗粒物排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号电炉二氧化硫排放量" prop="cHbzx2dl2yhl">-->
          <!--<el-input v-model="form.cHbzx2dl2yhl" placeholder="请输入2号电炉二氧化硫排放量" />-->
        <!--</el-form-item>-->
        <!--<el-form-item label="2号电炉氮氧化物排放量" prop="cHbzx2dlDyhw">-->
          <!--<el-input v-model="form.cHbzx2dlDyhw" placeholder="请输入2号电炉氮氧化物排放量" />-->
        <!--</el-form-item>-->
        <el-form-item label="备注" prop="remake">
          <el-input v-model="form.remake" placeholder="请输入备注" />
        </el-form-item>
        <!--<el-form-item label="删除标志" prop="cState">-->
          <!--<el-input v-model="form.cState" placeholder="请输入删除标志" />-->
        <!--</el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listHbzx, getHbzx, delHbzx, addHbzx, updateHbzx } from "@/api/scrb/hbzx";

export default {
  name: "Hbzx",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 环保中心生产日报录入表格数据
      hbzxList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        cHbzxl1jlKlw: null,
        cHbzx1jl2yhl: null,
        cHbzx1jlDyhw: null,
        cHbzx2jlKlw: null,
        cHbzx2jl2yhl: null,
        cHbzx2jlDyhw: null,
        cHbzx5jlKlw: null,
        cHbzx5jl2yhl: null,
        cHbzx5jlDyhw: null,
        cHbzx6jlKlw: null,
        cHbzx6jl2yhl: null,
        cHbzx6jlDyhw: null,
        cHbzxJhglKlw: null,
        cHbzxJhgl2yhl: null,
        cHbzxJhglDyhw: null,
        cHbzx6glKlw: null,
        cHbzx6hgl2yhl: null,
        cHbzx6hglDyhw: null,
        cHbzx1hzyKlw: null,
        cHbzx1hzy2yhl: null,
        cHbzx1hzyDyhw: null,
        cHbzx2hzyKlw: null,
        cHbzx2hzy2yhl: null,
        cHbzx2hzyDyhw: null,
        cHbzxQyjKlw: null,
        cHbzxQyj2yhl: null,
        cHbzxQyjDyhw: null,
        cHbzx1dlKlw: null,
        cHbzx1dl2yhl: null,
        cHbzx1dlDyhw: null,
        cHbzx2dlKlw: null,
        cHbzx2dl2yhl: null,
        cHbzx2dlDyhw: null,
        remake: null,
        zfree1: null,
        zfree2: null,
        zfree3: null,
        zfree4: null,
        zfree5: null,
        zfree6: null,
        zfree7: null,
        zfree8: null,
        zfree9: null,
        zfree10: null,
        zfree11: null,
        zfree12: null,
        zfree13: null,
        zfree14: null,
        zfree15: null,
        cState: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      },
      isInsert:true,
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询环保中心生产日报录入列表 */
    getList() {
      this.loading = true;
      listHbzx(this.queryParams).then(response => {
        this.hbzxList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        cDate: null,
        cHbzxl1jlKlw: null,
        cHbzx1jl2yhl: null,
        cHbzx1jlDyhw: null,
        cHbzx2jlKlw: null,
        cHbzx2jl2yhl: null,
        cHbzx2jlDyhw: null,
        cHbzx5jlKlw: null,
        cHbzx5jl2yhl: null,
        cHbzx5jlDyhw: null,
        cHbzx6jlKlw: null,
        cHbzx6jl2yhl: null,
        cHbzx6jlDyhw: null,
        cHbzxJhglKlw: null,
        cHbzxJhgl2yhl: null,
        cHbzxJhglDyhw: null,
        cHbzx6glKlw: null,
        cHbzx6hgl2yhl: null,
        cHbzx6hglDyhw: null,
        cHbzx1hzyKlw: null,
        cHbzx1hzy2yhl: null,
        cHbzx1hzyDyhw: null,
        cHbzx2hzyKlw: null,
        cHbzx2hzy2yhl: null,
        cHbzx2hzyDyhw: null,
        cHbzxQyjKlw: null,
        cHbzxQyj2yhl: null,
        cHbzxQyjDyhw: null,
        cHbzx1dlKlw: null,
        cHbzx1dl2yhl: null,
        cHbzx1dlDyhw: null,
        cHbzx2dlKlw: null,
        cHbzx2dl2yhl: null,
        cHbzx2dlDyhw: null,
        remake: null,
        zfree1: null,
        zfree2: null,
        zfree3: null,
        zfree4: null,
        zfree5: null,
        zfree6: null,
        zfree7: null,
        zfree8: null,
        zfree9: null,
        zfree10: null,
        zfree11: null,
        zfree12: null,
        zfree13: null,
        zfree14: null,
        zfree15: null,
        cState: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.cDate)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.isInsert=true;
      this.title = "添加环保中心生产日报录入";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const cDate = row.cDate || this.ids
      this.isInsert=false;
      getHbzx(cDate).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改环保中心生产日报录入";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (!this.isInsert) {
            updateHbzx(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addHbzx(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const cDates = row.cDate || this.ids;
      this.$modal.confirm('是否确认删除环保中心生产日报录入编号为"' + cDates + '"的数据项？').then(function() {
        return delHbzx(cDates);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('scrb/hbzx/export', {
        ...this.queryParams
      }, `hbzx_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style lang="scss" scoped>
  table
  {
    border-collapse: collapse;
    margin: 0 auto;
    text-align: center;
  }
  table td, table th
  {
    border: 1px solid #cad9ea;
    color: #666;
    height: 30px;
  }
  table thead th
  {
    background-color: #CCE8EB;
    width: 100px;
  }
  table tr:nth-child(odd)
  {
    background: #fff;
  }
  table tr:nth-child(even)
  {
    background: #F5FAFA;
  }
</style>

